package com.mashibing.dp.strategy;

public class Cat/* implements Comparable<Cat>*/ {
    int weight, height;

    public Cat(int weight, int height) {
        this.weight = weight;
        this.height = height;
    }

    // 自定义比较
    /*@Override
    public int compareTo(Cat c) {
        if(this.weight < c.weight) return -1;
        else if(this.weight > c.weight) return 1;
        else return 0;
    }*/

    // 要使用Arrays.toString对数组的打印，类中需要 toString() 方法
    @Override
    public String toString() {
        return "Cat{" +
                "weight=" + weight +
                ", height=" + height +
                '}';
    }
}
